<?php
namespace Api\Controller;
use Think\Controller;
class OrderController extends Controller {
    public function getOrder(){

        // $m_id = $_GET['m_id'];

        $order = M('order');
        $data = $order -> order("order_id")->select();

        echo json_encode($data);
         echo "<br>";

    }
    public function orderdetail(){
      $order_id=$_GET['order_id'];
      $ordermodel=M('order');
      $order=$ordermodel->find($order_id); 
      $this->order=$order;
      exit(json_encode($order));
    } 

    public function addOrder(){

    $data['order_id']=$_GET['order_id'];
    $data['user_id']=$_GET['user_id'];
    $data['acticity_id']=$_GET['activity_id'];
    $data['order_price']=$_GET['order_price'];
    $data['order_time'] =  date("Y-m-d H:i:s"); 
    $ordermodel=M('order');                                         
    $order=$ordermodel->add($data);
    if(false !==$order){   
    $this->ajaxReturn(SUCCESS,'JSON');
    }else{
        //$this->false;
         $this->ajaxReturn($FALSE,'JSON');
    }
  

}
}
?>